package com.tchintech.pay.utils;

import android.app.Activity;
import android.app.ProgressDialog;
import android.content.Context;

/**
 * cn.woogo.micp.utils
 * Created with Android Studio
 * user: John
 * Date:2016-06-25
 * Time:11:41
 */
public class MyDialog extends ProgressDialog {
    Activity mParentActivity;

    public MyDialog(Context context) {
        super(context);
        mParentActivity = (Activity) context;
    }

    @Override
    public void dismiss() {
        if (mParentActivity != null && !mParentActivity.isFinishing()) {
            super.dismiss(); // 调用超类对应方法
        }
    }
}